using System;

namespace BitMango
{
	[Serializable]
	public class InventoryItem
	{
		public InventoryItem()
		{
			this.id = string.Empty;
			this.name = string.Empty;
			this.count = 0;
			this.consumable = false;
			this.hidden = true;
		}

		public InventoryItem(string _id)
		{
			InventoryItem inventoryItemByID = Context.UncleBill.GetInventoryItemByID(_id);
			if (inventoryItemByID == null)
			{
				this.id = _id;
				return;
			}
			this.id = inventoryItemByID.id;
			this.name = inventoryItemByID.name;
			this.consumable = inventoryItemByID.consumable;
			this.count = inventoryItemByID.count;
			this.hidden = inventoryItemByID.hidden;
			if (inventoryItemByID.count < 0)
			{
				this.count = int.MaxValue;
			}
			else
			{
				this.count = inventoryItemByID.count;
			}
		}

		public bool IsInfinite
		{
			get
			{
				return this.count == int.MaxValue || this.count < 0;
			}
		}

		public string id;

		public string name;

		public int count;

		public bool consumable;

		public bool hidden;
	}
}
